The present invention relates generally to a distributed database system, and more particularly to data replication upon re-configuration of a partial database to update an additional attribute of an object in a distributed database.
With a distributed database, copies of data objects may exist on several servers and the servers may be geographically dispersed. The objects of the distributed database each include attributes that may be modified on at least some of the servers. However, when a modification is made to an attribute of an object of the database on one of the servers, the copies of the objects in the other servers retain the old data until such copies are updated to reflect the modification. The typical way of updating the copies of the objects in other servers is called replication.
During a replication, a xe2x80x9csourcexe2x80x9d server sends data to a xe2x80x9cdestinationxe2x80x9d server, and the destination server updates its database with the objects that were modified. A server is a xe2x80x9csourcexe2x80x9d server or a xe2x80x9cdestinationxe2x80x9d server only with reference to a particular replication. For example, a first server may receive data from a second server during a replication. With respect to such replication, the first server is a destination server and the second server is a source server. However, the first server may later send data to a third server during a second replication. With respect to the second replication, the first server is a source server and the third server is a destination server.
A server on which a modification to an object is initially made, rather than an update received through a replication, is referred to as an xe2x80x9coriginatingxe2x80x9d server. A server is an xe2x80x9coriginatingxe2x80x9d server with respect to a modification, rather than a replication. For example, if an object is modified on a first server, the first server is an originating server with reference to such modification. The originating server may be a source server, a destination server, or neither during a later replication.
To facilitate replication, each server capable of being a source server includes an update sequence number (USN). The USN is a number increasing by at least one for each revision to the database on a server. The USN typically is a monotonically increasing number. The USN of a server may increase upon a modification made on such server (i.e., a modification made on an originating server) or upon receiving an update from a replication.
To facilitate replication, each server includes an up-to-date (UTD) vector table. The UTD vector table includes a data field corresponding to each other server in the networked computer system having a portion of the database. Corresponding to each server in the table, the UTD vector table includes a data field representing a USN of the corresponding server and together, the data fields represent a server-USN pair and represent how up-to-date the server is with respect to the other servers in the system. When a destination server receives data through replication from a source server, such destination server records the highest USN of the source server in the UTD vector table of the destination server. In this manner, each destination server maintains how up-to-date it is with respect to each server acting as a source server to such destination server.
In some cases, a server contains a portion of a database that is a subset of the entire database, the server being referred to herein as a partial replica server. The portion of the database with the subset of the entire database is referred to herein as the partial database. In particular, the partial database may be configure to update only a portion of the attributes of each object of the entire database. For example, a database may contain objects having attributes A, B, C and D. However, the partial database maybe configured to update only attributes A and B. Therefore, such partial database includes only the attributes that such partial database is configured to update (e.g., A and B), and replicates only such attributes during a replication.
A partial replica server updates the partial database in the same way that other servers perform updating, i.e., through replication as described above. For example, the partial replica server (i.e., the server containing the partial database) may replicate attributes A and B but not replicate attributes C and D.
However, when the partial database is re-configured to update an additional attribute, a conventional replication system assumes that all UTD vectors are invalid, and therefore, requests all attributes from a source server from USN zero. USN zero is defined herein as the first USN occurring on a server. Therefore, a request of all attributes from a source server from USN zero, is in fact a request for all revisions on such server. For example, if a partial replica server containing a partial database is originally configured to update attributes A and B, but then is re-configured to update attribute C, the partial replica server requests all revisions to attributes A, B and C from a source server during a replication.
The revision on the server may be from a modification made on such server or from updates received during a replication. This method of requesting all attributes from USN zero may significantly increase the amount of transactions that occur during the replication process. For large databases, this operation may generate excessive network traffic and significant replication and server operational delays, especially if the servers in the computer system are geographically dispersed.
In view of the foregoing, there is a need for a method for allowing for efficient replication to a partial replica server upon re-configuring a partial database to update an additional attribute of an object in a distributed database.
The present invention is directed to systems and methods for efficient data replication upon re-configuration of a partial database to update an additional attribute in a distributed database.
According to aspects of the present invention, a computer system comprises a plurality of servers. A database is distributed across the plurality of servers. The database includes a plurality of objects, each object has a first attribute and a second attribute. Each server periodically replicates values of attributes from another server thereto during a replication.
Each server maintains an increasing update sequence number that is increased upon each revision to the attributes of the objects of the database on such server. Each server maintains an attribute value table that includes for each attribute of each object at such server a value of the attribute for the object, the update sequence number of such server when the value was updated locally or replicated thereto. Each server maintains a vector table that includes for each other server from which the server replicates, the update sequence number of such other server at a time of a most recent replication from such other server. The database at a source server includes the first attribute and the second attribute for each object. The database at a destination server originally includes the first attribute and not the second attribute for each object. The database at the destination server is changed to include the first attribute and the second attribute for each object.
Upon such change, the destination server requests from the attribute value table of the source server, the value of the second attribute for each object at such source server. The destination server receives into the attribute value table thereof, the value of the second attribute for each object at such source server and the current update sequence number of the destination server to be associated with the value. The destination server requests from the attribute value table of the source server, the value of the first attribute for each object at such source server, if the update sequence number of the source server associated with the value in the attribute value table of the source server is greater than the update sequence number associated with the source server in the vector table of the destination server. The destination server receives into the attribute value table thereof, the value of the first attribute for each object at such source server, if the update sequence number of the source server is greater than the update sequence number associated with the source server in the vector table of the destination server.
The above-listed features, as well as other features, of the present invention will be more fully set forth hereinafter.